package com.yan.dome01;

import java.util.ArrayList;
import java.util.List;

public class UnsafeList {
    
    public static void main(String[] args) throws InterruptedException {
        List<String> list = new ArrayList<String>();
        for (int i = 0; i < 1000; i++) {
            new Thread(()->{
                list.add((Thread.currentThread()).getName());
            }).start();
        }
        Thread.sleep(100);
        System.out.println(list.size());
    }
}
